#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2024/6/17 10:01
# @Author : 闫峰
# @File    : rb_product_group_sku.py
from common.setting import ensure_path_sep
from utils.mysqlUtils.db_pool import Database

product_db = Database(ensure_path_sep("\\config\\shopeev2_config.yaml.bak"), "HWY-ZH-GZ-RDS-Product")


class RbProductGroupSku:

    @staticmethod
    def get_group_sku_list_by_sku(sku_set):
        """
        """
        filter_sql = f"""
        SELECT group_sku FROM `zhcxkj-center-product`.rb_product_group_sku
         WHERE sku in %s
        """
        group_sku_set = product_db.fetch_all_tuple(filter_sql, (sku_set,))
        if not len(group_sku_set):
            return None
        return list(map(lambda x:x[0], group_sku_set))